package cn.bonoon.entities.interacting;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import cn.bonoon.kernel.support.entities.AbstractEntity;

/**
 * 常见问题的分类，如：业务问题、操作问题等分类
 * @author jackson
 *
 */
@Entity
@Table(name = "t_faqc")
public class FaqCatalogEntity extends AbstractEntity{

	private static final long serialVersionUID = -3094727486287780481L;

	/** 这个常见问题的分类包含哪些问题和回答 */
	@OneToMany(mappedBy = "catalog")
	private List<FaqEntity> faqs;
	
	/** 被发布到哪些子系统 */
	@OneToMany(mappedBy = "catalog")
	private List<FaqReleaseEntity> releases;

	/** 是否发布在平台；如果是，则任何人登录后在平台的首页都可以看到 */
	@Column(name = "C_PLATFORM")
	private boolean platform;

	@Column(name = "C_DISABLE")
	private boolean disable;

	/** 可以调整常见问题分类排列的顺序 */
	@Column(name = "C_ORDINAL")
	private int ordinal;

	/**
	 * 1：公开，在前台显示的时候，没有登录也可以看到
	 * 2：会员，需要登录前台的会员系统可以看到
	 * 其它值就只有登录后台才可以看到
	 * 
	 * 与{@link FaqEntity#level}一致，即某个级别看某些内容；
	 * 如果某个用户看不到本分类，那么这个分类下的级别怎么设置，这个用户都看不到
	 */
	@Column(name = "C_LEVEL")
	private int level;

	public List<FaqEntity> getFaqs() {
		return faqs;
	}

	public void setFaqs(List<FaqEntity> faqs) {
		this.faqs = faqs;
	}

	public List<FaqReleaseEntity> getReleases() {
		return releases;
	}

	public void setReleases(List<FaqReleaseEntity> releases) {
		this.releases = releases;
	}

	public boolean isPlatform() {
		return platform;
	}

	public void setPlatform(boolean platform) {
		this.platform = platform;
	}

	public boolean isDisable() {
		return disable;
	}

	public void setDisable(boolean disable) {
		this.disable = disable;
	}

	public int getOrdinal() {
		return ordinal;
	}

	public void setOrdinal(int ordinal) {
		this.ordinal = ordinal;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
}
